feat(ledger): add config profiles and configurable retry ceiling - #140
Merged
Conversation
Restructure application.yml into a baseline plus dev, test, and prod overlays. The dev profile targets local services, test stays Testcontainers-compatible (no hardcoded datasource), and prod references every sensitive value through an environment-variable placeholder with no secret literals. Bind the optimistic-lock retry ceiling to fincore.ledger.idempotency.max-attempts (default 3, validated >= 1) via a typed IdempotencyProperties, replacing the hardcoded constant so the count changes through configuration, not code. #62 AC-5 (live docker-compose boot) is verified by #66, which delivers the compose file and image. Closes #58 Closes #62
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Introduces dev/test/prod Spring profiles and makes the optimistic-lock retry ceiling configurable.
Why
The service ran on a single bare
application.ymlwith no environment separation and no home for tunables. The retry ceiling was a hardcodedconst val MAX_ATTEMPTS = 3; #58 requires it to change via configuration.How
application.ymlplusapplication-dev.yml(local services),application-test.yml(Testcontainers-compatible, no hardcoded datasource so@DynamicPropertySourcestays authoritative),application-prod.yml(${ENV}placeholders only,ddl-auto: validate).IdempotencyProperties(@Validated,@Min(1), default 3) bound underfincore.ledger.idempotency.max-attempts, injected intoIdempotencyServiceImpl, registered via@EnableConfigurationPropertiesonLedgerApplicationand on the three@DataJpaTestITs that import the service.IdempotencyPropertiesTest(ApplicationContextRunner) proves default binds to 3, overrides bind, and a value below 1 is rejected.IdempotencyServiceImplTestgains an AC-5 case proving a configured ceiling drives the attempt count.The retry boundary is unchanged (retry stays outside the transaction); only the count is injected.
Scope note
#62 AC-5 (service starts with the
devprofile under Docker Compose) is verified by #66, which delivers the compose file and image (neither exists yet).Closes #58
Closes #62